home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / CHIP Haziran 2001.iso / prog / share / 04 / setup.exe / MM9.Cab / F1481_parseasp.asp.9B3B646D_CB56_4EAE_BAB7_3E7E8E41A649 < prev    next >
Text File  |  2000-08-17  |  1KB  |  49 lines

  1. <!-- #INCLUDE FILE="../include/utils.runtime5.asp" -->
  2. <%
  3.  
  4. '
  5. ' Support for GoLive Preview of .asp files.
  6. '
  7. ' COPYRIGHT (c) 1999-2000 Adobe Systems Incorporated. All rights reserved.
  8. '
  9.  
  10. ' WARNING: This file is for use on a staging server only.
  11. '           Do NOT copy this file to your production site.
  12.  
  13. Response.Buffer = False
  14.  
  15. RejectUnauthorizedCallers
  16.  
  17. set fso = CreateObject("Scripting.FileSystemObject")
  18.  
  19. virtualname = Request("FileName")
  20. if Len(virtualname) > 0 then
  21.     filename = Server.MapPath(virtualname)
  22.  
  23.     filedata = Request("FileData")
  24.     if Len(filedata) > 0 then
  25.         foldername = fso.GetParentFolderName(filename)
  26.         if not fso.FolderExists(foldername) then fso.CreateFolder(foldername)
  27.         set f = fso.CreateTextFile(filename, True)
  28.         f.Write filedata
  29.         f.Close
  30.         if "Microsoft-IIS/5.0" = Request.ServerVariables( "SERVER_SOFTWARE" ) then
  31.             Server.Transfer virtualname
  32.         else
  33.             Response.Redirect virtualname
  34.         end if
  35.     else
  36.         if False = RuntimeDebug then
  37.             on error resume next
  38.         end if
  39.         fso.DeleteFile filename, True
  40.         if err then
  41.             Response.Write "Error deleting " & Request("FileName") & vbNewLine & err.Description
  42.         else
  43.             Response.Write Request("FileName") & " has been deleted."
  44.         end if
  45.     end if
  46. end if
  47.  
  48. %>
  49.